const {Bill} = require("../model/model.js");

const BillDao = {
	// 保存职位数据
	save(billInfo) {
		console.log(billInfo);
		const bill = new Bill(billInfo);
		return bill.save();
	},
	//分页查询
	findByPage(page){
		const pageSize=5;
		return Bill.find({}).limit(pageSize).skip((page - 1) * pageSize);
	},
	//删除
	delete(id){
		console.log("dajun",id);
		return Bill.remove({_id : id});
	}
}

module.exports = BillDao;